<template>
  <uni-fab
    ref="fab"
    :pattern="pattern"
    :content="content"
    horizontal="left"
    vertical="top"
    direction="horizontal"
    @trigger="trigger"
  />
</template>

<script setup lang="ts">
import uniFab from "@/uni_modules/uni-fab/components/uni-fab/uni-fab.vue";

const content = [
  {
    iconPath: "/static/logo.png",
    selectedIconPath: "/static/image-active.png",
    text: "分析",
    active: false,
  },
  {
    iconPath: "/static/logo.png",
    selectedIconPath: "/static/home-active.png",
    text: "结果",
    active: false,
  },
];

const pattern = {
  color: "#7A7E83",
  backgroundColor: "#fff",
  selectedColor: "#007AFF",
  buttonColor: "#007AFF",
  iconColor: "#fff",
  icon: "right",
};

function trigger(e: any) {
  if (e.index === 1) {
    uni.navigateTo({
      url: "/pages/result/index",
    });
  } else {
    uni.navigateTo({
      url: "/pages/index/index",
    });
  }
}
</script>

<style scoped></style>
